package work;

public class Test {
    int anum = 5;
    static int bnum = 10;
    public static void main(String[] args) {
        long  num = Integer.MAX_VALUE;
        System.out.println(num/1024/1024);//KB/MB/GB


        System.out.println(new Test().anum);
        System.out.println(bnum);
        int[] a = {10,20,30,40,50};
        int[] b = new int[6]; //0,0,0,0,0,0
        //a:源数组
        //1:源数组的起始下标
        //b:目标数组
        //0:目标数组的起始下标
        //4:要复制的元素个数
        int n = 9;
        if(n>10){
            return;
        }
        System.arraycopy(a,1,b,0,4); //灵活性好
        for(int i=0;i<b.length;i++){
            System.out.println(b[i]);
        }

        Poo p1 = new Poo();
        Poo p2 = new Poo();
        Poo p3 = new Poo();
        Poo p4 = new Poo();
        Poo p5 = new Poo();

        int a1 = 5;
        int b1 = 6;
        int c1 =10;
        System.out.println(c1 < a1+b1);

        //数组，查询的月份是数组的最后一位数，所以需要加数组长度+1
        int month = 12;
        int [] arr = new int [month];
        //默认0和1月都是1对
        arr[0] = 1;
        arr[1] = 1;
        System.out.println("第1个月的兔子有1对，总数是2");
        System.out.println("第2个月的兔子有1对，总数是2");
        //从第三个月开始，开始遵循规律
        for(int i =2;i<month;i++) {
            arr[i] = arr[i-1] + arr[i-2];
            System.out.println("第" + (i+1) + "个月的兔子有" + arr[i] + "对, 总数是" + arr[i]*2);
        }
    }
}

class Poo{
    static{
        System.out.println("静态块");
    }
    Poo(){
        System.out.println("构造方法");
    }
}
